// #include <stdint.h>
#include "apt32f102_gpio.h"
#include "apt32f102_adc.h"
#include "../LCD/HT162X_Pin.h"

#ifndef CHIP_H
#define CHIP_H

typedef enum
{
    ADC_Switch = 0, 
    ADC_Oven = 1, 
    ADC_Meat1 = 2, 
    ADC_Meat2 = 3, 
    ADC_BAT_V = 4, 
    ADC_INTVREF_1v = 5,

    ADC_Length = 6 
}ADC_Seq_E;

//Key
#define IO_Key1 EXI13 //PA
#define IO_Key2 EXI1 //PB
#define IO_Key3 EXI4 //PB
#define IO_KeyLed EXI0 //PB

// #define CrossZero EXI3 //PB

//Beep
#define IO_Buzzer EXI10 //PA

//Temp
#define IO_Oven EXI11 //PA
#define IO_Probe1 EXI12 //PA
#define IO_Probe2 EXI5 //PA
#define ADC_Channel_Oven ADC12_ADCIN12 //烤炉AD通道
#define ADC_Channel_Meat2 ADC12_ADCIN4 //肉探针2AD通道
#define ADC_Channel_Meat1 ADC12_ADCIN13 //肉探针1AD通道

//Motor control
#define IO_Heater EXI15 //PA //点火风扇
#define IO_Feed EXI14 //PA //进料风扇
#define IO_Fan EXI5 //PB //排气风扇['

//Switch Key
#define IO_Switch EXI8 //PA
#define ADC_Channel_Switch ADC12_ADCIN9

//ADC Seq
#define ADC_Seq_Switch 0
#define ADC_Seq_Oven 1
#define ADC_Seq_Meat1 2
#define ADC_Seq_Meat2 3


void SystemConfig(void);
uint32_t SamplingSingle(uint32_t channel);
void PinConfig_LCD(void);

#endif
